/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "adm_formacion_profesional")
@NamedQueries({
    @NamedQuery(name = "AdmFormacionProfesional.findAll", query = "SELECT a FROM AdmFormacionProfesional a")})
public class AdmFormacionProfesional implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "afp_id")
    private Integer afpId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 64)
    @Column(name = "afp_nombre")
    private String afpNombre;
    @Column(name = "afp_estado")
    private Integer afpEstado;
    @OneToMany(mappedBy = "admFormacionProfesional", fetch = FetchType.LAZY)
    private List<AdmMedico> admMedicoList;

    public AdmFormacionProfesional() {
    }

    public AdmFormacionProfesional(Integer afpId) {
        this.afpId = afpId;
    }

    public AdmFormacionProfesional(Integer afpId, String afpNombre) {
        this.afpId = afpId;
        this.afpNombre = afpNombre;
    }

    public Integer getAfpId() {
        return afpId;
    }

    public void setAfpId(Integer afpId) {
        this.afpId = afpId;
    }

    public String getAfpNombre() {
        return afpNombre;
    }

    public void setAfpNombre(String afpNombre) {
        this.afpNombre = afpNombre;
    }

    public Integer getAfpEstado() {
        return afpEstado;
    }

    public void setAfpEstado(Integer afpEstado) {
        this.afpEstado = afpEstado;
    }

    public List<AdmMedico> getAdmMedicoList() {
        return admMedicoList;
    }

    public void setAdmMedicoList(List<AdmMedico> admMedicoList) {
        this.admMedicoList = admMedicoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (afpId != null ? afpId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AdmFormacionProfesional)) {
            return false;
        }
        AdmFormacionProfesional other = (AdmFormacionProfesional) object;
        if ((this.afpId == null && other.afpId != null) || (this.afpId != null && !this.afpId.equals(other.afpId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.AdmFormacionProfesional[ afpId=" + afpId + " ]";
    }
    
}
